home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / mcomm551.zip / EXTRA.H < prev    next >
C/C++ Source or Header  |  1991-07-14  |  2KB  |  68 lines

  1.  
  2. /****************************************************************************
  3.  EXTRA.H -- miscellaneous functions
  4.    Mike Dumdei,  6 Holly Lane,  Texarkana TX  75503    (c) 1989,1990
  5. ****************************************************************************/
  6.  
  7. #ifndef MCOMM
  8.   #define _C_ cdecl
  9.   #define _V_ volatile
  10.   #define _F_ far
  11.   #if (__TURBOC__ && __HUGE__)
  12.     #define _N_
  13.   #else
  14.     #define _N_ near
  15.   #endif
  16.   #define MCOMM
  17. #endif
  18.  
  19. #if __cplusplus
  20.   extern "C" {
  21. #endif
  22. #if __ZTC__
  23.   #define INTERRUPT
  24. #else
  25.   #define INTERRUPT interrupt
  26. #endif
  27.  
  28. #define SET_TO_TENTHS(to, tenths)   set_timeout((&to), (tenths)*9/5)
  29. #define SET_TO_SECS(to, secs)       set_timeout((&to), (secs)*18)
  30. #define SET_TO_MINS(to, mins)       set_timeout((&to), (mins)*1080)
  31. #define DELAY_TENTHS(tenths)        tdelay((tenths)*9/5)
  32. #define DELAY_SECS(secs)            tdelay((secs)*18)
  33. #define DELAY_MINS(mins)            tdelay((mins)*1080)
  34.  
  35. /* function declarations */
  36. int _C_ calc_crc(char *blk, int blksz);
  37. int _C_ update_crc(int oldcrc, char ch);
  38. int _C_ strcntch(char *str, char ch_to_cnt);
  39. char * _C_ strrstr(char *str1, char *str2);
  40. char * _C_ strpbrkf(char *str1, char *str2);
  41. char * _C_ strrtrim(char *str);
  42. char * _C_ strltrim(char *str);
  43. char * _C_ strtrim(char *str);
  44. char * _C_ strsum(char *, ...);               /* dest, str1, str2, ..., NULL */
  45. char * _C_ strrjust(char *str, int fldwidth, char pad);
  46. char * _C_ strljust(char *str, int fldwidth, char pad);
  47. char * _C_ strcentr(char *str, int fldwidth, char pad);
  48. int _C_ watchdogset(int flag, int commchipadrs);
  49. void INTERRUPT _F_ watchdoghook(void);
  50. int _C_ ctshookset(int flag, int port, int chipadrs);
  51. void INTERRUPT _F_ int14ctshook(void);
  52.  
  53.  /*------- NEW TIMER FUNCTIONS ---------*/
  54. #ifndef TIMER_H
  55. int _C_ tickhookset(int flag); /* MUST disable before exiting program !!!!! */
  56. void _C_ set_timeout(long *timer, unsigned ticks);
  57. void _C_ set_longtimeout(long *timer, long ticks);
  58. int _C_ timed_out(long *timer);
  59. void _C_ tdelay(unsigned ticks);
  60. long _C_ get_ticker(void);
  61. #define TIMER_H
  62. #endif
  63.  
  64. #if __cplusplus
  65.   }
  66. #endif
  67.  
  68.